package com.tanhua.dubbo.api.mongo;

import com.tanhua.dubbo.api.db.MongoQuestionApi;
import com.tanhua.model.mongo.Question;
import org.apache.dubbo.config.annotation.DubboService;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

@DubboService
public class MongoQuestionApiImpl implements MongoQuestionApi {
    @Autowired
    private MongoTemplate mongoTemplate;
    @Override
    public Question findQuestionById(ObjectId objectId) {

        return mongoTemplate.findById(objectId,Question.class);
    }
}
